<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
    <meta name="format-detection" content="telephone=no"/>
    #parse("/h5/common/webWords.html")
    <link rel="stylesheet" type="text/css" href="http://${staticHost}/css/stcss.css"/>
    <link rel="stylesheet" type="text/css" href="http://${staticHost}/css/page.css"/>
    <!--  <title>考试详情-多选</title>-->
    <script type="text/javascript" src="http://${staticHost}/js/jquery.js"></script>
    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="http://${staticHost}/js/continuingEducation.js"></script>
    <script type="text/javascript" src="http://${staticHost}/js/ajaxFileUpload.js"></script>
    <script src="http://${staticHost}/js/layer.js"></script>
    <style type="text/css">
        body {
            background: #ffffff;
        }

        .span_title {
            width: 100%;
            display: block;
            font-size: 1.2rem;
            text-align: left;
            height: 2rem;
            line-height: 2rem;
            margin-bottom: .5rem;
            /*vertical-align: top;*/
        }
        .cut_line{
            border-bottom: 0.15rem dotted #cccccc;
        }
        .span_line {
            color: #666666;
            width: 100%;
            font-size: 1.2rem;
            text-align: left;
            min-height: 2rem;
            line-height: 2rem;
            margin-top: 1.5rem;
            position: relative;
        }

        .span_line img{
            width: auto;
            max-width: 90%;
            margin: .5rem;
            display: inline-block;
            vertical-align:middle;
        }

        .span_checkBox {
            display: inline-block;
            height: 2rem;
            position: absolute;
            top: 50%;
            margin-top:-1rem;
        }
        .span_item_hit{
            display: inline-block;
            height: 2rem;
            position: absolute;
            top: 50%;
            left: 2.5rem;
            margin-top:-1rem;
        }

        .span_item {
            display: block;
            margin-left: 4rem;
        }

        .span_item img {
            display: inline-block;
            width: auto;
            max-width: 90%;
            margin: .5rem;
            vertical-align: middle;
        }

        .span_answer {
            display: none;
            width: 80%;
            min-height: 8rem;
            margin: 0 auto;
            background: #c6c6c6;
            border-radius: .5rem;
            padding: 1rem;
        }

        /*******************************答题卡样式***********************/

        .answer_shade {
            width: 100%;
            height: 100%;
            position: fixed;
            top: 0;
            left: 0;
            background: #e4e4e4;
            opacity: .7;
            display: none;
        }

        .answer_card {
            display: none;
            background: #ffffff;
            border-radius: 1rem 1rem 0 0;
            text-align: center;
            padding-bottom: 15%;
            width: 100%;
            bottom: 3rem;
            position: fixed;
            bottom: 0;
            left: 0;
        }

        .answer_card_top {
            height: 4rem;
            line-height: 4rem;
            text-align: center;
            border-bottom: .07rem solid #e4e4e4;
        }

        .answer_card_content {
            text-align: left;
            margin: 0 auto;
            width: 90%;
            font-size: 0;
            padding: 1rem 0;
        }

        .answer_card_content .ball_box {
            display: inline-block;
            border: 0;
            margin: 0;
            width: 20%;
            font-size: 1.6rem;
            text-align: center;
            vertical-align: middle;
            margin-top: 1rem;
        }

        .answer_card_content .ball_box .ball {
            display: block;
            margin: 0 auto;
            width: 50%;
            background-color: #fb696d;
            color: #ffffff;
            border-radius: 50%;
            position: relative;
        }

        .answer_card_content .ball_box .do_not {
            background: #ffffff;
            border: .1rem solid #999999;
            color: #999999;
        }

        .answer_card_content .ball_box .ball span {
            top: 50%;
            left: 0;
            display: inline-block;
            position: absolute;
            width: 100%;
            margin-top: -30%;
            vertical-align: middle;
        }

        .answer_card_content .ball_box .ball:before {
            content: '';
            display: block;
            padding-top: 100%;
        }

        .open_Card {
            display: inline-block;
            position: absolute;
            right: .5rem;
            width: 2rem;
            right: 1rem;
            vertical-align: middle;
            height: 2rem;
            border: .3rem solid #999;
            border-radius: .3rem;
        }

        .open_Card:before {
            content: '';
            height: .4rem;
            width: 1.5rem;
            background: #999;
            display: block;
            position: absolute;

            top: .3rem;
            left: .3rem;
            box-shadow: 0 .5rem 0 #999, 0 1rem 0 #999;
        }

        .close_Card {
            float: left;
            margin-left: .5rem;
            width: 4rem;
            height: 4rem;
            color: #999999;
        }

        .btn_red {
            color: #ffffff;
            background: #fb696d;
        }

        /*******************************答题卡样式***********************/


        .over {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #f5f5f5;
            opacity:0.5;
            z-index: 1000;
        }

        .layout {
            display: none;
            position: absolute;
            top: 40%;
            left: 40%;
            width: 20%;
            height: 20%;
            z-index: 1001;
            text-align:center;
        }
    </style>
</head>
<body>
<div id="over" class="over"></div>
<div id="layout" class="layout"><img src="http://${staticHost}/images/loading.gif" /></div>
    <section class="global_section_noBg" style="margin-top: 1rem;">
        <h3>$!examTitleMap.exam_title <span class="open_Card"></span></h3>
        <input type="hidden" id="examId" value="$!examTitleMap.id"/>
    </section>
    <section class="global_section_noBg center">
        <span class="title">考试详情</span>
        <input type="hidden" id="sumNum" value="$!sumNum"/>
        <span class="span_littleFont">已做：<label id="alreadyTest">$!alreadyCount</label>题</span>
        <span class="span_littleFont">剩余：<label id="remainTest">$!surplusCount</label>题</span>
        <span class="span_littleFont">时长：<label id="minuteShow">$!examTitleMap.exam_time_limit</label> 分钟 </span><!--<label id="secondShow" style="display: none">0</label>秒-->
        <span class="span_littleFont">成绩：<label id="examStore">$!examScore</label>分</span>
        <input type="hidden" id="courseId" value="$!courseId"/>
        <input type="hidden" id="semesterId" value="$!semesterId"/>
        <input type="hidden" id="subjectNum" value="1" />
        <input type="hidden" id="examStatus" value="$!examStatus" />
        <input type="hidden" id="exceedTerm" value="$!exceedTerm" />
        <input type="hidden" id="testIds" value="$!testIds" />
    </section>
    #set($maxValue=1)
    #set($maxMainValue=1)
    #set($maxOptValue=1)
    #foreach($form in $!examSubjectList)
    #if($maxMainValue == 1)
        <section class="global_section_noBg" id="subject$!maxValue">
    #else
        <section class="global_section_noBg" id="subject$!maxValue" style="display: none">
    #end
            <span class="span_title">
                        $!form.exam_no、$!form.exam_subject
            </span>
            <input type="hidden" id="examStId$!maxValue" value="$!form.id"/>
            #set($formMain = $!form.examMain)
            #set($examChecked = 0)
            #set($examAnswers = $!formMain.answerIds)
            <!-- 小题目容器 -->
            <section id="examMain$!maxValue">
                <span class="span_line">  $!formMain.test_no,$!formMain.test_stem
                    #if(!($!formMain.test_img_url != "" && $!formMain.test_stem == ""))
                     （）
                    #end
                    #if($!formMain.test_img_url != "")
                    <img src="$!imageHost$!formMain.test_img_url"/>
                    #end

                </span>
                <input type="hidden" id="testId$!maxValue" value="$!formMain.test_id"/>
                <input type="hidden" id="testType$!maxValue" value="$!formMain.test_type"/>

                <section>
                    #if($!formMain.test_type != 2 && $!formMain.test_type != 1 )
                    <div class="span_line">
                         文本答案：
                        <textarea rows="10" cols="52" style="border: .2rem solid #aaa;text-align: justify;color: #666666;" name="answerText" id ="answerText">#if($!examStatus == "2")$!formMain.answerText#end</textarea>
                        图片答案：
                        <input type="hidden" id="answerImg" name="answerImg" value="" />
                        <input type="file" id="upLoad" multiple="true" name="upLoad" style="display:none;" onchange="imgChange(this)"/>
                        <div style="width: 100%;display: table;margin-bottom: 5px;">
                            <div style="width: 100%;display: table-cell;vertical-align: middle;">
                                <span><img id="photos" #if($!examStatus != '2') onclick="addImage()" #end #if (!$formMain.answerImg || "$!formMain.answerImg" == "") src="http://${staticHost}/images/tu.jpg" #else src="$imageHost$!formMain.answerImg" #end default="#if (!$ssi.electronicPhotos || "$ssi.electronicPhotos" == "")http://${staticHost}/images/tu.jpg#else$imageHost$!formMain.answerImg"#end" /></span>
                            </div>
                        </div>
                    </div>
                    #else

                        #foreach($formOption in $!formMain.examOption)
                        #if($examAnswers != "")
                        #set($optionChecked = ','+$!formOption.test_option_id+',')
                          #if($examAnswers.indexOf($optionChecked) > -1 && $!examStatus == "2")
                            #set($examChecked = 1)
                          #else
                            #set($examChecked = 0)
                          #end
                        #end
                        #if($!formMain.test_type == 2)
                        <!--多选-->
                        <div class="span_line">
                            <span class="span_checkBox">
                                #if($examChecked == 1)
                                <input type="checkbox" name="topic$!maxValue" id="item$!maxOptValue" checked="checked" value="$!formOption.test_option_id"/>
                                #else
                                <input type="checkbox" name="topic$!maxValue" id="item$!maxOptValue" value="$!formOption.test_option_id"/>
                                #end
                                <label for="item$!maxOptValue"></label>
                            </span>
                            <span class="span_item_hit">
                                $!formOption.test_option,
                            </span>
                            <span class="span_item">
                                $!formOption.test_option_stem
                                #if($!formOption.test_option_img_url != "")
                                <img src="$!imageHost$!formOption.test_option_img_url">
                                #end
                            </span>
                         </div>
                        #else
                        <!--单选-->
                        <div class="span_line">
                            <span class="span_checkBox">
                                #if($examChecked == 1)
                                <input type="radio" name="topic$!maxValue" id="item$!maxOptValue" checked="checked" value="$!formOption.test_option_id" />
                                #else
                                <input type="radio" name="topic$!maxValue" id="item$!maxOptValue" value="$!formOption.test_option_id"/>
                                #end
                                <label for="item$!maxOptValue"></label>
                            </span>
                            <span class="span_item_hit">
                                $!formOption.test_option,
                            </span>
                            <span class="span_item">
                                $!formOption.test_option_stem
                                 #if($!formOption.test_option_img_url != "")
                                <img src="$!imageHost$!formOption.test_option_img_url">
                                #end
                            </span>
                        </div>
                        #end
                        #set($maxOptValue= ($!maxOptValue +1))
                        #end
                    #end
                </section>
                <!-- 答案解析 -->
                #if($!examStatus == "2")
                <section class="global_section_noBg">
                    <span class="span_title color" onclick="answerClick(this)">答案解析</span>
                    <div class="span_answer">
                        #if($!formMain.test_type != 2 && $!formMain.test_type != 1 )

                        #else
                                <span class="span_line">答案：
                                    <span class="color_red">
                                            #foreach($formAnswer in $!formMain.examAnswer)
                                                $!formAnswer.test_answer
                                            #end
                                    </span>
                                </span>
                        #end
                        <span class="span_line">$!formMain.examExplain.test_explain</span>
                    </div>
                </section>
                #end
            </section>
        </section>
        #set($maxValue= ($!maxValue +1))
    </section>
    #set($maxMainValue= ($!maxMainValue +1))
    #end
    <input type="hidden" value="$!remainTest" id="subjectMaxNum"/>
    <section class="global_section_noBg" style="margin-top: 1rem;margin-bottom: 20%;">
        <input class="global-button" type="button" value="上一题" id="last_q"/>
        <input class="global-button float_right" type="button" value="下一题" id="next_q"/>
    </section>
    <section class="global_section_noBg center" style="margin-top: .5rem;margin-bottom: 15%;display: none;" id="submit_d">
        <input class="global-button btn_default" id="submit_q" type="button" value=" 提    交 "/>
    </section>
    <section class="global_section_noBg center" style="margin-top: .5rem;margin-bottom: 15%;display: none;" id="confirm_d">
        <input class="global-button btn_default" id="confirm_q" type="button" onclick="confirmChange(this)" value=" 确    认 " optionNum=""/>
    </section>
    <!-- 答题卡 -->
    <section class="answer_shade"> </section>
    <section class="answer_card">
        <div class="answer_card_top"><span class='close_Card'>X</span>答题卡</div>
        <div class="answer_card_content">
            #foreach($form in $!examSubjectList)
            #if($!examStatus == 2)
            <div class='ball_box' onclick="ballClick($velocityCount)">
                <span class='ball' id="ball$velocityCount">
                    <span>$velocityCount
                    </span>
                </span>
            </div>
            #else
            <div class='ball_box' onclick="ballClick($velocityCount)">
                <span class='ball do_not' id="ball$velocityCount">
                    <span>$velocityCount
                    </span>
                </span>
            </div>
            #end
            #end
        </div>
        <input class="global-button btn_red" type="button" style="display: none;" value=" 交卷并查看结果 " />
    </section>
    <!-- 底部 begin -->
    <div class="fixdiv">
        <ul>
            <li><a href="/exam/auth/examIndex"><img src="http://${staticHost}/images/foticon001.jpg"><span>返回</span></a></li>
            <li><a href="/edu/auth/modifyPwd"><img src="http://${staticHost}/images/foticon004.jpg"><span>重置密码</span></a></li>
            <li><a href="javascript:void(0)" onclick="loginOut()"><img src="http://${staticHost}/images/foticon003.jpg"><span>退出系统</span></a></li>
        </ul>
    </div><script src="http://${staticHost}/js/layer.js"></script>

    <script type="text/javascript">
        function showMessage(msg){
            layer.open({
                content: msg
                ,btn: '关闭'
            });
        }
        function loginOut(){
            $.ajax({
                type:'post',
                url:'/edu/auth/loginOut',
                contentType:'application/x-www-form-urlencoded; charset=utf-8',
                success: function (result) {
                    showMessage("您已安全退出梦想在线教育服务系统");
                    window.location.href='/';
                }
            });
        }

        function addImage(){
            document.getElementById("upLoad").click();
        }

        //返回选取文件的本地路径
        function imgChange(obj) {
            if($(obj).val()){
                ajaxImageUpload(obj);
            }
        }


        function ajaxImageUpload() {
            var fileName = "";
            showLoading();
            var eltFile=document.getElementById("upLoad");//获得文件对象
            if(eltFile.files[0] == undefined){
                hideLoading();
                showMessage("请选择要上传的文件!");
                return;
            }
            var len=eltFile.files[0].size/1024;
            if(len > 1024){
                hideLoading();
                showMessage("上传文件超过限制1MB大小,请重新选择");
                return;
            }

            $.ajaxFileUpload({
                url : "/schoolroll/auth/uploadPic",
                dataType : 'json',
                fileElementId : 'upLoad',
                success : function(data, status) {
                    if(data.msg=="success"){
                        var imgUrl = data.imageUrl;
                        var fileName = data.fileName;
                        $("#photos").attr('src',imgUrl);
                        $("#answerImg").val(fileName);
                        hideLoading();
                        showMessage("上传成功,提交后保存");
                    }else{
                        hideLoading();
                        showMessage(data.msg);
                    }
                },
                error : function(data, status, e) {
                    console.log(e);
                    console.log(data);
                    hideLoading();
                    showMessage("图片上传失败!");
                }
            });
        }

    </script>
    <!-- 底部 end -->
    <script type="text/javascript">
        var checkedexam = $("#testIds").val();
        var minute = '$!examTitleMap.exam_time_limit';
        minute = parseInt(minute);
        var second = minute * 60;
        var intDiff = parseInt(second);//倒计时总秒数量
        function timer(intDiff){
            window.setInterval(function(){
                var minute=0,
                    second=0;//时间默认值       
                if(intDiff > 0){
                    minute = Math.floor(intDiff / 60);
                    second = Math.floor(intDiff) - (minute * 60);
                }
                if (minute <= 9) minute = '0' + minute;
                if (second <= 9) second = '0' + second;
                $('#minuteShow').html(+minute);
                //$('#secondShow').html(+second);
                intDiff--;
            }, 1000);
        }

        var saveStatus =  '$!remainTest';
        saveStatus = parseInt(saveStatus);
        $(function () {
            $("#last_q").click(function () {
                examSuject(0);
                $("#confirm_d").hide();
            });
            $("#next_q").click(function () {
                examSuject(1);
                $("#confirm_d").hide();
            });
            $("#submit_q").click(function () {
                save();
            });
            $(".open_Card").click(function(){
                $(".answer_shade").slideToggle("linear");
                $(".answer_card").slideToggle("linear");
            });
            $(".close_Card").click(function(){
                $(".answer_shade").slideToggle("linear");
                $(".answer_card").slideToggle("linear");
            });
            var examStatus = $("#examStatus").val();
            if (examStatus < 1){
                timer(intDiff);
            }
        })

        function answerClick(answer) {
            $(answer).next(".span_answer").slideToggle("linear");
        }

        //题库切换
        function examSuject(type) {
            var subjectNum = $("#subjectNum").val();
            var subjectMaxNum = $("#subjectMaxNum").val();
            var examStatus = $("#examStatus").val();
            var exceedTerm = $("#exceedTerm").val();
            var answerText = $("#answerText").val();
            var answerImg = $("#answerImg").val();
            var alreadyTest = $("#alreadyTest").html().trim();
            var remainTest = $("#remainTest").html().trim();

            if (type == 0) {
                if (parseInt(subjectNum) > 1) {
                    $("#subject" + parseInt(subjectNum) + "").hide();
                    $("#subject" + (parseInt(subjectNum) - 1) + "").show();
                    $("#subjectNum").val(parseInt(subjectNum) - 1);
                    //$("input[name=topic"+subjectNum+"]").removeAttr("checked");
                } else {
                    alert("已是第一题...")
                }
                $("#submit_d").hide();
            } else {

                var testType = $("#testType"+subjectNum+"").val();
                var answerIds = "";
                if (testType == 1){
                    answerIds = $("input[name=topic"+subjectNum+"]:checked").val();

                    if (typeof(answerIds) != "undefined" && answerIds.length > 0 && (examStatus < 2 || exceedTerm == 1)){
                        answer(subjectNum);
                    }
                }else if (testType == 2){
                    $(":checkbox[name=topic"+subjectNum+"]:checked").each(function () {
                        answerIds += $(this).val() + ",";
                    });

                    if (typeof(answerIds) != "undefined" && answerIds.length > 0 && (examStatus < 2 || exceedTerm == 1)){
                        answer(subjectNum);
                    }
                }else{
                    if((typeof(answerText) != "undefined" && answerText.length > 0)|| (typeof(answerImg) != "undefined" && answerImg.length > 0)){
                        answer(subjectNum);
                    }
                }


                if ((typeof(answerIds) != "undefined" && answerIds.length > 0 )|| (typeof(answerText) != "undefined" && answerText.length > 0)|| (typeof(answerImg) != "undefined" && answerImg.length > 0)){
                    if ($("#ball" + parseInt(subjectNum) + "").attr("class") !="ball"){
                        saveStatus = saveStatus -1;
                    }
                    $("#ball" + parseInt(subjectNum) + "").attr("class","ball");
                }
                if (0 > (parseInt(subjectNum) - parseInt(subjectMaxNum))) {
                    $("#subject" + (parseInt(subjectNum) + 1) + "").show();
                    $("#subject" + parseInt(subjectNum) + "").hide();
                    $("#subjectNum").val(parseInt(subjectNum) + 1)
                } else {
                    $("#submit_d").show();
                }
            }
        }

        //答题
        function answer(optionNum) {

            var courseId = $("#courseId").val();
            var semesterId = $("#semesterId").val();
            var examId = $("#examId").val();
            var subjectMaxNum = $("#subjectMaxNum").val();
            var examStId = $("#examStId"+optionNum+"").val();
            var testId = $("#testId"+optionNum+"").val();
            var testType = $("#testType"+optionNum+"").val();
            var exceedTerm = $("#exceedTerm").val();

            var alreadyTestNum = parseInt($("#alreadyTest").text());
            var answerIds = "";
            var answerText = "";
            var answerImg = "";
            if (testType == 1){
                answerIds = $("input[name=topic"+optionNum+"]:checked").val();
            }else if(testType == 2){
                $(":checkbox[name=topic"+optionNum+"]:checked").each(function () {
                    answerIds += $(this).val() + ",";
                });
                answerIds = answerIds.substring(0,answerIds.length-1);
            }else{
                answerText = $("#answerText").val();
                answerImg = $("#answerImg").val();
            }
            alreadyTestNum+=1;
            showLoading();
            $.ajax({
                type: 'post',
                url: '${requestHost}/exam/auth/examDetail/answer',
                contentType: 'application/x-www-form-urlencoded; charset=utf-8',
                data: {
                    courseId: courseId,
                    semesterId : semesterId,
                    examId: examId,
                    examStId: examStId,
                    testId: testId,
                    answerIds: answerIds,
                    answerText: answerText,
                    answerImg: answerImg,
                    exceedTerm : exceedTerm
                },
                success: function (result) {
                    hideLoading();
                    if (result.status == '00000000') {
                        if(checkedexam.indexOf(testId)==-1){
                            $("#alreadyTest").text(alreadyTestNum);
                            $("#remainTest").text(parseInt(subjectMaxNum) - parseInt(alreadyTestNum));
                            checkedexam+=testId+",";
                        }
                    }else {
                        alert(result.message);
                    }
                }
            });
        }

        //提交
        function save() {

            var courseId = $("#courseId").val();
            var semesterId = $("#semesterId").val();
            var examId = $("#examId").val();
            var minuteShow = $("#minuteShow").html().trim();
            var examStatus = $("#examStatus").val();
            var exceedTerm = $("#exceedTerm").val();

            if (examStatus > 0){
                alert("已提交试卷");
                return;
            }

            if (saveStatus != 0){
                 alert("有试题未选择答案，请查看右上角答题卡，待全部作答后，点击提交");
                 return
            }

            if (confirm("确定答完题，要提交考试试题吗？") == false){
                return;
            }
            showLoading();
            $.ajax({
                type: 'post',
                url: '${requestHost}/exam/auth/examDetail/save',
                contentType: 'application/x-www-form-urlencoded; charset=utf-8',
                data: {
                    courseId: courseId,
                    semesterId : semesterId,
                    examId: examId,
                    minuteShow : minuteShow,
                    exceedTerm : exceedTerm
                },
                success: function (result) {
                    if (result.status == '00000000') {
                        alert("提交成功");
                        $('#examStore').html(result.info);
                        document.location.reload();
                    }else {
                        alert("服务器错误");
                        hideLoading();
                    }
                }
            });
        }
        
        function ballClick(id) {
            var sumNum = $("#sumNum").val();
            if(sumNum-id>0){
                $("#confirm_d").show();
                $("#confirm_q").attr("optionNum",id);
            }
            $("#submit_d").hide();
            var subjectNum = $("#subjectNum").val();
            var subjectMaxNum = $("#subjectMaxNum").val();
            var examStatus = $("#examStatus").val();
            var exceedTerm = $("#exceedTerm").val();
            var testType = $("#testType"+subjectNum+"").val();
            var answerIds = "";
            if (testType == 1){
                answerIds = $("input[name=topic"+subjectNum+"]:checked").val();
            }else {
                $(":checkbox[name=topic"+subjectNum+"]:checked").each(function () {
                    answerIds += $(this).val() + ",";
                });
                answerIds = answerIds.substring(0,answerIds.length-1);
            }

            $("#subject" + parseInt(subjectNum) + "").hide();
            $("#subject" + parseInt(id) + "").show();
            $("#subjectNum").val(parseInt(id));

            if (examStatus < 2) {
                var alreadyCount = $("#alreadyTest").text();
                $("#remainTest").text(parseInt(subjectMaxNum) - (alreadyCount));

            }else {
                // $("#subject" + parseInt(subjectNum) + "").hide();
                // $("#subject" + parseInt(id) + "").show();
                // $("#subjectNum").val(parseInt(id));
            }
            $(".answer_shade").slideToggle("linear");
            $(".answer_card").slideToggle("linear");
        }
        
        //选择 确认事件
        function confirmChange(obj) {

            var optionNum = $(obj).attr("optionNum");
            var examStatus = $("#examStatus").val();
            var exceedTerm = $("#exceedTerm").val();
            var testType = $("#testType"+optionNum+"").val();
            var answerIds = "";
            if (testType == 1){
                answerIds = $("input[name=topic"+optionNum+"]:checked").val();
            }else {
                $(":checkbox[name=topic"+optionNum+"]:checked").each(function () {
                    answerIds += $(this).val() + ",";
                });
                answerIds = answerIds.substring(0,answerIds.length-1);
            }
            if (typeof(answerIds) != "undefined" && answerIds.length > 0){
                if ($("#ball" + parseInt(optionNum) + "").attr("class") !="ball"){
                    saveStatus = (saveStatus - 1);
                }
                $("#ball" + parseInt(optionNum) + "").attr("class","ball");
            }
            if (typeof(answerIds) != "undefined" && answerIds.length > 0 && (examStatus < 2 || exceedTerm == 1)){
                answer(optionNum);
                $("#confirm_d").hide();
            }
        }
        function showLoading(){
            document.getElementById("over").style.display = "block";
            document.getElementById("layout").style.display = "block";
        }

        function hideLoading(){
            document.getElementById("over").style.display = "none";
            document.getElementById("layout").style.display = "none";
        }

    </script>
</body>
</html>
